package com.slaffka.services;

import com.slaffka.model.Theme;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * _User: v.tsapaev
 * Date: 18.02.12
 * Time: 23:15
 * To change this template use File | Settings | File Templates.
 */
@Service
public class ThemeService {

//    @Autowired
//    private ThemeDAO themeDAO;
    @Autowired
    private SessionFactory sessionFactory;

    @Transactional
    public List<Theme> getThemeList() {
        return (List<Theme>) sessionFactory
                .getCurrentSession().createQuery("from Theme").list();
        //themeDAO.getThemeList();  //To change body of implemented methods use File | Settings | File Templates.
    }
}
